/*
 * Diego Zamboni Latance 			344990
 * Fellipe Augusto Ruiz de Souza 	344796
 * 
 */
package ast;

import java.util.ArrayList;

public class ReadCommand extends Statement {

	public ReadCommand() {
		variables = new ArrayList<Variable>();
		thiss = new boolean[50];
	}

	public void setThis(int in) {
		this.thiss[in] = true;
	}

	public void addVariable(Variable v) {
		variables.add(v);
	}

	public void genC(PW pw) {

	}

	public void genKrakatoa(PW pw) {
		pw.printIdent("read (");
		for (int i = 0; i < variables.size(); i++) {
			pw.print(variables.get(i).getName());
			if (variables.size() > i + 1)
				pw.print(", ");
		}
		pw.print(");\n");
	}

	private ArrayList<Variable> variables;
	boolean[] thiss;
}